
public class HW7_2SP5 {

	   public static void main(String args[])
	   {
	      int[][] a={{1,2,3},{4,5,6}};
	      int[][] d={{1,1,1},{2,2,2}};
	      int[][] c=new int[2][];
	      c[0]=new int[2];
	      c[1]=new int[2];
	      int[][] z;

	      z=c;      
	      c=d;   
	      square(a);
	      d=a;  
	   
	      

	      print(a);
	      print(d);
	      print(c);
	      print(z);
	      

	      
	   }
	   
	   private static void square(int[][] bArr)
	   {
	      for(int i=0;i<bArr.length;i++)
	      {      
	         for(int j=0;j<bArr[i].length;j++)
	            bArr[i][j]=bArr[i][j]*bArr[i][j];
	         
	      }   
	   }    
	         
	   private static void print(int[][] arr)
	   {
	      for(int i=0;i<arr.length;i++)
	      {
	         for(int j=0;j<arr[i].length;j++)
	            System.out.print(arr[i][j]+" ");
	         System.out.println();      
	      }
	      System.out.println();
	   }                        
	      
}
